/* GUI CONVERTED from rewocl.p (converter v1.76) Sun Aug 25 21:00:02 2002 */
/* rewocl.p - CUMULATIVE ORDER ACCOUNTING CLOSE                         */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.11.1.6 $                                                         */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 4.0     LAST MODIFIED: 03/11/88    BY: rl  *A171*          */
/* REVISION: 4.0     LAST MODIFIED: 05/04/88    BY: flm *A222*          */
/* REVISION: 4.0     LAST MODIFIED: 05/06/88    BY: flm *A229*          */
/* REVISION: 4.0     LAST MODIFIED: 05/06/88    BY: flm *A232*          */
/* REVISION: 4.0     LAST MODIFIED: 08/29/88    BY: flm *A414*          */
/* REVISION: 4.0     LAST MODIFIED: 08/30/88    BY: flm *A415*          */
/* REVISION: 4.0     LAST MODIFIED: 09/07/88    BY: flm *A424*          */
/* REVISION: 4.0     LAST MODIFIED: 09/19/88    BY: flm *A439*          */
/* REVISION: 4.0     LAST MODIFIED: 11/14/88    BY: emb                 */
/* REVISION: 4.0     LAST MODIFIED: 02/01/89    BY: flm *A629*          */
/* REVISION: 4.0     LAST MODIFIED: 02/01/89    BY: wug *A631*          */
/* REVISION: 4.0     LAST MODIFIED: 02/10/89    BY: flm *A644*          */
/* REVISION: 5.0     LAST MODIFIED: 02/28/89    BY: flm *B055*          */
/* REVISION: 5.0     LAST MODIFIED: 04/24/89    BY: flm *B103*          */
/* REVISION: 5.0     LAST MODIFIED: 04/24/89    BY: mlb *B105*          */
/* REVISION: 5.0     LAST MODIFIED: 06/20/89    BY: wug *B153*          */
/* REVISION: 5.0     LAST MODIFIED: 06/23/89    BY: mlb *B159*          */
/* REVISION: 5.0     LAST MODIFIED: 07/05/89    BY: bjj *B106*          */
/* REVISION: 5.0     LAST MODIFIED: 09/26/89    BY: mlb *B316*          */
/* REVISION: 5.0     LAST MODIFIED: 01/22/90    BY: wug *B515*          */
/* REVISION: 6.0     LAST MODIFIED: 05/11/90    BY: wug *D002*          */
/* REVISION: 6.0     LAST MODIFIED: 10/24/90    BY: pml *D143*          */
/* REVISION: 6.0     LAST MODIFIED: 03/14/91    BY: wug *D472*          */
/* REVISION: 6.0     LAST MODIFIED: 04/17/91    BY: emb *D532*          */
/* REVISION: 7.0     LAST MODIFIED: 10/23/91    BY: pma *F003*          */
/* REVISION: 7.0     LAST MODIFIED: 02/19/92    BY: pma *F214*          */
/* REVISION: 7.0     LAST MODIFIED: 02/25/92    BY: pma *F085*          */
/* REVISION: 7.0     LAST MODIFIED: 04/24/92    BY: emb *F434*          */
/* REVISION: 7.0     LAST MODIFIED: 08/12/92    BY: pma *F779*          */
/* REVISION: 7.3     LAST MODIFIED: 12/29/92    BY: pma *G382*          */
/* REVISION: 7.3     LAST MODIFIED: 02/05/93    BY: ram *G636*          */
/* REVISION: 7.3     LAST MODIFIED: 02/18/93    BY: emb *G700*          */
/* REVISION: 7.3     LAST MODIFIED: 03/18/93    BY: emb *G876*          */
/* REVISION: 7.4     LAST MODIFIED: 07/22/93    BY: pcd *H039*          */
/* REVISION: 7.4     LAST MODIFIED: 01/12/94    BY: qzl *H276*          */
/* REVISION: 7.4     LAST MODIFIED: 05/24/94    BY: pxd *FN34*          */
/* REVISION: 7.4     LAST MODIFIED: 09/15/94    by: slm *GM63*          */
/* REVISION: 7.4     LAST MODIFIED: 10/31/94    BY: WUG *GN76*          */
/* REVISION: 7.4     LAST MODIFIED: 11/01/94    by: ame *GN86*          */
/* REVISION: 7.5     LAST MODIFIED: 12/14/94    by: mwd *J034*          */
/* REVISION: 7.4     LAST MODIFIED: 01/11/95    BY: srk *G0B8*          */
/* REVISION: 8.5     LAST MODIFIED: 09/05/95    BY: srk *J07G*          */
/* REVISION: 8.5     LAST MODIFIED: 03/27/96    BY: jym *G1Q9*          */
/* REVISION: 8.5     LAST MODIFIED: 05/01/96    BY: jym *G1MN*          */
/* REVISION: 8.6     LAST MODIFIED: 06/11/96    BY: ejh *K001*          */
/* REVISION: 8.5     LAST MODIFIED: 06/20/96    BY: taf *J0VG*          */
/* REVISION: 8.5     LAST MODIFIED: 07/26/96    BY: *J10X* Markus Barone   */
/* REVISION: 8.6E    LAST MODIFIED: 02/23/98    BY: *L007* A. Rahane       */
/* REVISION: 8.6E    LAST MODIFIED: 05/20/98    BY: *K1Q4* Alfred Tan      */
/* REVISION: 8.6E    LAST MODIFIED: 10/04/98    BY: *J314* Alfred Tan      */
/* REVISION: 9.1     LAST MODIFIED: 03/24/00    BY: *N08T* Annasaheb Rahane*/
/* REVISION: 9.1     LAST MODIFIED: 08/12/00    BY: *N0KP* myb             */
/* REVISION: 9.1     LAST MODIFIED: 09/11/00    BY: *N0RQ* BalbeerS Rajput */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Old ECO marker removed, but no ECO header exists *F246*                    */
/* Revision: 1.11.1.5    BY: Katie Hilbert     DATE: 05/15/02  ECO: *P06H*  */
/* $Revision: 1.11.1.6 $          BY: Vivek Gogte       DATE: 08/06/02  ECO: *N1QQ*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}

{gldydef.i new}
{gldynrm.i new}

define new shared variable gldetail  like mfc_logical
                                     label "Print Account Detail"
                                     no-undo initial yes.
define new shared variable gltrans   like mfc_logical
                                     label "Print GL Summary"
                                     no-undo initial no.
define new shared variable nbr       like wo_nbr
                                     label "Cumulative Order".
define new shared variable nbr1      like wo_nbr.
define new shared variable lot       like wo_lot.
define new shared variable lot1      like wo_lot.
define new shared variable part      like wo_part.
define new shared variable part1     like wo_part.
define new shared variable site      like wo_site.
define new shared variable site1     like wo_site.
define new shared variable project   like wo_project.
define new shared variable project1  like wo_project.
define new shared variable salesjob  like wo_so_job.
define new shared variable salesjob1 like wo_so_job.
define new shared variable eff_date  like glt_effdate initial today.

if can-find(first qad_wkfl where qad_key1 = "WO-CLOSE") then do:
   /* OLD WORK ORDER DATA STORAGE HAS BEEN DETECTED IN QAD_WKFL */
   {pxmsg.i &MSGNUM=1361 &ERRORLEVEL=1}
   /* PLEASE RUN "UTQADWO.P" BEFORE EXECUTING THIS FUNCTION     */
   {pxmsg.i &MSGNUM=1362 &ERRORLEVEL=1}
   pause.
   hide message no-pause.
   return.
end.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
nbr            colon 21
   nbr1           label {t001.i} colon 45
   lot            colon 21
   lot1           label {t001.i} colon 45
   part           colon 21
   part1          label {t001.i} colon 45
   site           colon 21
   site1          label {t001.i} colon 45
   project        colon 21
   project1       label {t001.i} colon 45
   salesjob       colon 21
   salesjob1      label {t001.i} colon 45
   skip (1)
   eff_date       colon 21
   gldetail       colon 21
   gltrans        colon 21 skip
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

mainloop:
repeat:

   if nbr1      = hi_char then nbr1      = "".
   if lot1      = hi_char then lot1      = "".
   if part1     = hi_char then part1     = "".
   if site1     = hi_char then site1     = "".
   if project1  = hi_char then project1  = "".
   if salesjob1 = hi_char then salesjob1 = "".

   update
      nbr
      nbr1
      lot
      lot1
      part
      part1
      site
      site1
      project
      project1
      salesjob
      salesjob1
      eff_date
      gldetail
      gltrans
   with frame a.

   if eff_date = ? then do:
      eff_date = today.
      display eff_date with frame a.
   end.
   /* CHECK GL EFFECTIVE DATE */

   find first gl_ctrl no-lock no-error.
   if not available gl_ctrl then do:

      msg_var1 = getTermLabel("GENERAL_LEDGER",35).
      {pxmsg.i &MSGNUM=533 &ERRORLEVEL=3 &MSGARG1=msg_var1}
      undo , retry.
   end.

   bcdparm = "".
   {gprun.i ""gpquote.p"" "(input-output bcdparm,15,
        nbr,nbr1,lot,lot1,part,part1,site,site1,
        project,project1,salesjob,salesjob1,
        string(eff_date),string(gldetail),string(gltrans),
        null_char,null_char,
        null_char,null_char,null_char)" }

   if nbr1      = "" then nbr1      = hi_char.
   if lot1      = "" then lot1      = hi_char.
   if part1     = "" then part1     = hi_char.
   if site1     = "" then site1     = hi_char.
   if project1  = "" then project1  = hi_char.
   if salesjob1 = "" then salesjob1 = hi_char.

   if not batchrun then do:
      {gprun.i ""gpsirvr.p""
         "(input site, input site1, output return_int)"}
      if return_int = 0 then do:
         next-prompt site with frame a.
         undo mainloop, retry mainloop.
      end.
   end.

   /* OUTPUT DESTINATION SELECTION */
   {gpselout.i &printType = "printer"
               &printWidth = 132
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "yes"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.

   {mfphead.i}

   {gprun.i ""rewocla.p""}

   {mfrtrail.i}
end. /* repeat */
